package band.wukong.practice.javase.core.io.stream;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.SequenceInputStream;

/**
 * Desc:
 * Author: sunjs
 * Date: 2009-11-13 15:00:10
 */
public class TestSequenceStream {
    public static void main(String[] args) throws IOException {
        InputStream s1 = new ByteArrayInputStream("你".getBytes());
        InputStream s2 = new ByteArrayInputStream("好".getBytes());
        InputStream in = new SequenceInputStream(s1, s2);

        int data;
        while ((data = in.read()) != -1) {
            System.out.print(data + " ");
        }
        in.close();
    }
    /*
        output:  
        196 227 186 195     (jdk1.4.2)
        228 189 160 229 165 189     (jdk6)
     */
}
